package com.kksoft.readcm.views;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ImageView;

public class Toggle extends ImageView
{
  private s a;
  private Bitmap b;
  private Bitmap c;
  private boolean d = false;
  private int e;
  private int f;
  private boolean g = false;
  private aa h;

  public Toggle(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
    s locals = new s(this);
    this.a = locals;
    Bitmap localBitmap1 = BitmapFactory.decodeResource(getResources(), 2130837583);
    this.b = localBitmap1;
    Bitmap localBitmap2 = BitmapFactory.decodeResource(getResources(), 2130837582);
    this.c = localBitmap2;
  }

  private void a()
  {
    //this.g = 1;
    if (this.d)
      if (this.a.a() > 0.0F)
        this.a.b(-4.0F);
    while (true)
    {
      return;
     // b();
     // continue;
//      float f1 = this.a.a();
//      float f2 = this.a.b();
//      if (f1 < f2)
//      {
//        this.a.b(4.0F);
//        continue;
//      }
//      b();
    }
  }

  private void b()
  {
//    this.g = 0;
//    if (this.d);
//    int j;
//    for (int i = 0; ; j = 1)
//    {
//      a(i, 0);
//      return;
//    }
  }

  public final void a(aa paramaa)
  {
    this.h = paramaa;
  }

  public final void a(boolean paramBoolean)
  {
//    a(paramBoolean, 0);
  }

  public final void a(boolean paramBoolean1, boolean paramBoolean2)
  {
    this.d = paramBoolean1;
    if ((this.h != null) && (!paramBoolean2))
    {
      aa localaa = this.h;
      boolean bool = this.d;
      localaa.a(bool);
    }
    this.a.a(paramBoolean1);
    invalidate();
  }

  protected void onDraw(Canvas paramCanvas)
  {
    super.onDraw(paramCanvas);
    Bitmap localBitmap1 = this.a.c();
    float f1 = this.a.a();
    float f2 = this.e;
    float f3 = f1 + f2;
    float f4 = this.f;
    paramCanvas.drawBitmap(localBitmap1, f3, f4, null);
    Paint localPaint = new Paint();
    int i = this.a.d();
    localPaint.setAlpha(i);
    Bitmap localBitmap2 = this.c;
    float f5 = this.a.a();
    float f6 = this.e;
    float f7 = f5 + f6;
    float f8 = this.f;
    paramCanvas.drawBitmap(localBitmap2, f7, f8, localPaint);
    if (this.g)
    {
      a();
      invalidate();
    }
  }

  protected void onRestoreInstanceState(Parcelable paramParcelable)
  {
    Bundle localBundle = (Bundle)paramParcelable;
    Parcelable localParcelable = localBundle.getParcelable("superState");
    super.onRestoreInstanceState(localParcelable);
    boolean bool = localBundle.getBoolean("toggled");
//    a(bool, 0);
  }

  protected Parcelable onSaveInstanceState()
  {
    Bundle localBundle = new Bundle();
    Parcelable localParcelable = super.onSaveInstanceState();
    localBundle.putParcelable("superState", localParcelable);
    boolean bool = this.d;
    localBundle.putBoolean("toggled", bool);
    return localBundle;
  }

  protected void onSizeChanged(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    super.onSizeChanged(paramInt1, paramInt2, paramInt3, paramInt4);
    int i = getWidth();
    int j = this.b.getWidth();
    int k = (i - j) / 2;
    this.e = k;
    int m = getHeight();
    int n = this.b.getHeight();
    int i1 = (m - n) / 2;
    this.f = i1;
  }

  public boolean onTouchEvent(MotionEvent paramMotionEvent)
  {
    switch (paramMotionEvent.getAction())
    {
    default:
    case 2:
    case 1:
    }
    while (true)
    {
      invalidate();
      return true;
//      s locals = this.a;
//      int i = (int)paramMotionEvent.getX();
//      int j = this.e;
//      int k = i - j;
//      int m = this.a.e() / 2;
//      float f1 = k - m;
////      locals.a(f1);
//      continue;
//      a();
    }
  }
}

/* Location:           E:\AndroidDecompiler\jd-gui-0.3.3.windows\newrclasses.dex.dex2jar.jar
 * Qualified Name:     com.ideashower.readitlater.views.Toggle
 * JD-Core Version:    0.6.0
 */